<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function mytab() {
				var cells = document.getElementsByName("grid");
				for(var i = 0; i <= cells.length; i++) {
					cells[i].onclick = function() {
							alert(this.value);
						}
					};
				}
		
		</script>
	</head>

	<body onload="mytab()">
		<table border="" cellspacing="" cellpadding="" style="position: absolute;width:300px;height:100px;left:50%; top:50%;margin-left:-250px;margin-top:-100px;">
			<tr>
				<td><input name='grid' type="button" value="第一行第一列" /></td>
				<td><input name='grid' type="button" value="第一行第二列" /></td>
				<td><input name='grid' type="button" value="第一行第三列" /></td>
			</tr>
			<tr>
				<td><input name='grid' type="button" value="第二行第一列" /></td>
				<td><input name='grid' type="button" value="第二行第二列" /></td>
				<td><input name='grid' type="button" value="第二行第三列" /></td>
			</tr>
			<tr>
				<td><input name='grid' type="button" value="第三行第一列" /></td>
				<td><input name='grid' type="button" value="第三行第二列" /></td>
				<td><input name='grid' type="button" value="第三行第三列" /></td>
			</tr>
		</table>
	</body>

</html>